package org.ar.xmling;

import static org.junit.Assert.assertTrue;

import org.junit.Test;


public class DataLoading {

  private static final String SIMPLE_XML_DATA =
      "<plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-compiler-plugin</artifactId><version>3.1</version><configuration><source>1.6</source><target>1.6</target></configuration></plugin></plugins>";

  private static final String MIDDLE_XML_DATA =
      "<slideshow title=\"Sample Slide Show\" date=\"Date of publication\" author=\"Yours Truly\"><slide type=\"all\"><title>Wake up to WonderWidgets!</title></slide><slide type=\"all\"><title>Overview</title><item>Why <em>WonderWidgets</em> are great</item><item/><item>Who <em>buys</em> WonderWidgets</item></slide></slideshow>";


  @Test
  public void testSimpleXMLLoading() {
    XMLDocument doc = XMLUtil.stringToXMLDocument(SIMPLE_XML_DATA);
    assertTrue(SIMPLE_XML_DATA.equals(doc.print()));
  }


  @Test
  public void testMiddleXMLLoading() {
    XMLDocument doc = XMLUtil.stringToXMLDocument(MIDDLE_XML_DATA);
    System.out.println(doc.print());
  }

}
